import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from "tailwindcss";
import postcssPresetEnv from "postcss-preset-env"; //引入postcss-preset-env
import { resolve } from "path";
function pathResolve(dir: string) {
  return resolve(process.cwd(), ".", dir);
}
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: [
      {
        find: "@",
        replacement: pathResolve("src") + "/",
      },
    ],
    dedupe: ["vue"],
  },
  css: {
    postcss: {
      plugins: [postcssPresetEnv(), tailwindcss()],
    },
  },
})
